******************
*STUDY 1
******************

use "C:\Users\morrisl\Dropbox\Dowell\Study 1 data.dta", clear

*awareness of each treatment story
tab awareness treat, col

*got correct takeaway?
tab takeaway treat, col

*Table 1 (feelings by treatment condition)
tab feeling treat, col

*Online Appendix B, Table B2 (multinomial logit analysis of treatment effects on feeling)
mlogit feeling i.treat 
mlogit feeling i.treat if treat>=1

*Online Appendix B, Table B3 (mutivariate tests for heterogeneity by party, age, education)

mlogit feeling i.treat##i.demrep 
mlogit feeling i.treat##c.age
mlogit feeling i.treat##i.colldeg 

mlogit feeling i.treat##i.demrep if treat>=1
mlogit feeling i.treat##c.age if treat>=1
mlogit feeling i.treat##i.colldeg if treat>=2

*Online Appendix B, Table B4 (basic tabulation of feelings X treatment by party, age, education)

tab feeling treat if demrep==0, col
tab feeling treat if demrep==1, col
tab feeling treat if colldeg==0, col
tab feeling treat if colldeg==1, col
tab feeling treat if agebracket<=3, col
tab feeling treat if agebracket>3 & agebracket!=., col


*Figure 2: Treatment effects on Opposition to Tax Increase for School Spending
reg bill i.treat 
margins, at(treat= (0(1)3))
marginsplot, recast(scatter) horizontal level(95)

*Online Appendix B, Table B5 (multivariate tests for heterogeneity by party, age, education)
reg bill i.treat##i.colldeg
reg bill i.treat##i.demrep
reg bill i.treat##c.age


*Online Appendix B, Table B6 (treatment effects on level of immigration and immigration as benefit/burden)
reg level i.treat
reg benburd i.treat

clear

******************
*STUDY 2
******************

use "C:\Users\morrisl\Dropbox\Dowell\Study 2 data.dta", clear

*Table 2: Treatment Effects on Emotions among non-Hispanic Whites, Study 2
table demotreat if white==1 & hispanic==1, contents(mean anxious mean afraid mean uneasy)
table demotreat if white==1 & hispanic==1, contents(mean sad mean depressed)
table demotreat if white==1 & hispanic==1, contents(mean happy mean proud mean excited)
table demotreat if white==1 & hispanic==1, contents(mean hopeful)

*Online Appendix B, Table B7: Treatment Effects on Emotions among non-Hispanic Whites among those who Passed Attention Check, Study 2
table demotreat if white==1 & hispanic==1 & attentive==1, contents(mean anxious mean afraid mean uneasy)
table demotreat if white==1 & hispanic==1 & attentive==1, contents(mean sad mean depressed)
table demotreat if white==1 & hispanic==1 & attentive==1, contents(mean happy mean proud mean excited)
table demotreat if white==1 & hispanic==1 & attentive==1, contents(mean hopeful)

clear
******************
*STUDY 3
******************

use "C:\Users\morrisl\Dropbox\Dowell\Study 3 data.dta", clear

*Table 3: Emotional Reactions to Narratives among Non-Hispanic Whites
tab feeling treat if white==1 & hisplatino==0, col

*Online Appendix B, Table B8 (Multinomial logit analysis of treatment effects on feelings among Non-Hispanic Whites)
mlogit feelings i.treat if white==1 & hisplatino==0 

*Online Appendix B, Table B9 (Multinomial Logit Tests of Heterogeneity in Treatment Effects on Feelings among Non-Hispanic Whites by Party, Age, Education)
mlogit feelings i.treat##c.age if white==1 & hisplatino==0 
mlogit feelings i.treat##i.colldeg if white==1 & hisplatino==0
mlogit feelings i.treat##i.demrep if white==1 & hisplatino==0

*Online Appendix B, Table B10 (Basic Tabulation of Feelings X Treatment among non-Hispanic Whites, by Age, Educ, Party)
tab feelings treat if white==1 & hisplatino==0 & demrep==0, col 
tab feelings treat if white==1 & hisplatino==0 & demrep==1, col 
tab feelings treat if white==1 & hisplatino==0 & colldeg==0, col 
tab feelings treat if white==1 & hisplatino==0 & colldeg==1, col 
tab feelings treat if white==1 & hisplatino==0 & age<50, col 
tab feelings treat if white==1 & hisplatino==0 & age>=50 & age!=., col 

*Table 4: Emotional Reactions to Narratives among Non-Hispanic Whites
tab feeling treat if black==1 & hisplatino==0, col
tab feeling treat if hisplatino==1, col
tab feeling treat if asian==1 & hisplatino==0, col

*Online Appendix B, Table B11 (Multinomial Logit Estimates of Treatment Effects on Feelings among Non-White Groups)
mlogit feelings i.treat if hisplatino==0 & black==1
mlogit feelings i.treat if hisplatino==1
mlogit feelings i.treat if hisplatino==0 & asian==1

*Figure 3: Treatment Effects on Expected Increase in Anti-White Discrimination
reg discrimwhitesdiff i.treat if hisplatino==0 & white==1
margins, at(treat=(1 2 3 4 5)) 
marginsplot, recast(scatter) horizontal

*Online Appendix B, Table B12 (OLS Analysis of Heterogeneity in Treatment Effects on Whites' Expected Rise in Anti-White Discrim by Age, Educ, Party ID)
reg discrimwhitesdiff i.treat##c.age if white==1 & hisplatino==0
reg discrimwhitesdiff i.treat##i.colldeg if white==1 & hisplatino==0
reg discrimwhitesdiff i.treat##i.demrep if white==1 & hisplatino==0

*Table 5: Effects on Expectations of Increased Discrimination, by Race-Ethnicity
table treat if white==1 & hisplatino==0, contents(mean discrimwhitesdiff mean discrimblackdiff mean discrimasndiff mean discrimhispdiff)
table treat if black==1 & hisplatino==0, contents(mean discrimwhitesdiff mean discrimblackdiff mean discrimasndiff mean discrimhispdiff)
table treat if asian==1 & hisplatino==0, contents(mean discrimwhitesdiff mean discrimblackdiff mean discrimasndiff mean discrimhispdiff)
table treat if hisplatino==1, contents(mean discrimwhitesdiff1 mean discrimblackdiff mean discrimasndiff mean discrimhispdiff)

*Figure 4: Non-Whites' Average Expectations of Increased Discrimination Toward Blacks, Asians, and Latinos
reg discrimmindiff i.treat if race!=1
margins, at(treat=(1 2 3 4 5))
marginsplot, recast(scatter) horizontal

clear
